package edu.hrbu.mapper;

import edu.hrbu.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.awt.*;
import java.util.List;

@Mapper
public interface UserMapper {
    /**
     * 用户登录
     * @param userName 用户名
     * @param userPwd 密码
     * @return user
     */
    User checkUserLogin(@Param("userName") String userName,
                        @Param("userPwd") String userPwd);

    /**
     * 获取所有用户
     * @return list
     */
    List<User> getAllUser();

    User checkMyName(@Param("userId") Integer userId, @Param("userName") String userName);

    boolean editInfo(User user);

    List<User> getUserList(@Param("myRoleId") Integer myRoleId,
                           @Param("userName") String userName,
                           @Param("roleId") Integer roleId);

    User checkName(@Param("userName") String userName);

    boolean addUser(User user);

    User getUserById(@Param("userId") int userId, @Param("roleId") int roleId);

    boolean delUser(@Param("userId") int userId);

    List<User> getUserListByRoleId(@Param("roleId") int roleId);
}
